FROM python:3.10-slim

RUN useradd -m appuser
USER appuser
WORKDIR /chatgpt-web

ENV PATH="/home/appuser/.local/bin:$PATH"
COPY . .
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && pip install --no-cache-dir -r requirements.txt

CMD ["gunicorn", "-b", "0.0.0.0:8080", "main:server", "--timeout", "200", "--worker-class", "gevent"]
